/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbpedestad")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbpedestad.findAll", query = "SELECT p FROM Pyfntbpedestad p"),
    @NamedQuery(name = "Pyfntbpedestad.findByPyfntbpedestadid", query = "SELECT p FROM Pyfntbpedestad p WHERE p.pyfntbpedestadid = :pyfntbpedestadid"),
    @NamedQuery(name = "Pyfntbpedestad.findByReferencia", query = "SELECT p FROM Pyfntbpedestad p WHERE p.referencia = :referencia"),
    @NamedQuery(name = "Pyfntbpedestad.findByFecharef", query = "SELECT p FROM Pyfntbpedestad p WHERE p.fecharef = :fecharef"),
    @NamedQuery(name = "Pyfntbpedestad.findByFecharegistro", query = "SELECT p FROM Pyfntbpedestad p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbpedestad.findByObservaciones", query = "SELECT p FROM Pyfntbpedestad p WHERE p.observaciones = :observaciones"),
    @NamedQuery(name = "Pyfntbpedestad.findByFechaimpresion", query = "SELECT p FROM Pyfntbpedestad p WHERE p.fechaimpresion = :fechaimpresion"),
    @NamedQuery(name = "Pyfntbpedestad.findByDescripcion", query = "SELECT p FROM Pyfntbpedestad p WHERE p.descripcion = :descripcion")})
public class Pyfntbpedestad implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbpedestadid")
    private Integer pyfntbpedestadid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "referencia")
    private String referencia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharef")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharef;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechaimpresion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaimpresion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "scittbfadeceid", referencedColumnName = "scittbfadeceid")
    @ManyToOne
    private Scittbfadece scittbfadeceid;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyfntbpedidoid", referencedColumnName = "pyfntbpedidoid")
    @ManyToOne(optional = false)
    private Pyfntbpedido pyfntbpedidoid;
    @JoinColumn(name = "pyfntbestadoid", referencedColumnName = "pyfntbestadoid")
    @ManyToOne(optional = false)
    private Pyfntbestado pyfntbestadoid;

    public Pyfntbpedestad() {
    }

    public Pyfntbpedestad(Integer pyfntbpedestadid) {
        this.pyfntbpedestadid = pyfntbpedestadid;
    }

    public Pyfntbpedestad(Integer pyfntbpedestadid, String referencia, Date fecharef, Date fecharegistro, String observaciones, Date fechaimpresion, String descripcion) {
        this.pyfntbpedestadid = pyfntbpedestadid;
        this.referencia = referencia;
        this.fecharef = fecharef;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
        this.fechaimpresion = fechaimpresion;
        this.descripcion = descripcion;
    }

    public Integer getPyfntbpedestadid() {
        return pyfntbpedestadid;
    }

    public void setPyfntbpedestadid(Integer pyfntbpedestadid) {
        this.pyfntbpedestadid = pyfntbpedestadid;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public Date getFecharef() {
        return fecharef;
    }

    public void setFecharef(Date fecharef) {
        this.fecharef = fecharef;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Date getFechaimpresion() {
        return fechaimpresion;
    }

    public void setFechaimpresion(Date fechaimpresion) {
        this.fechaimpresion = fechaimpresion;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Scittbfadece getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Scittbfadece scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyfntbpedido getPyfntbpedidoid() {
        return pyfntbpedidoid;
    }

    public void setPyfntbpedidoid(Pyfntbpedido pyfntbpedidoid) {
        this.pyfntbpedidoid = pyfntbpedidoid;
    }

    public Pyfntbestado getPyfntbestadoid() {
        return pyfntbestadoid;
    }

    public void setPyfntbestadoid(Pyfntbestado pyfntbestadoid) {
        this.pyfntbestadoid = pyfntbestadoid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbpedestadid != null ? pyfntbpedestadid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbpedestad)) {
            return false;
        }
        Pyfntbpedestad other = (Pyfntbpedestad) object;
        if ((this.pyfntbpedestadid == null && other.pyfntbpedestadid != null) || (this.pyfntbpedestadid != null && !this.pyfntbpedestadid.equals(other.pyfntbpedestadid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbpedestad[ pyfntbpedestadid=" + pyfntbpedestadid + " ]";
    }
    
}
